window = gtk_widget_get_window (widget);
if (gtk_cairo_should_draw_window (cr, window))
{
- cairo_save (cr);
-
- cairo_translate (cr, -allocation.x, -allocation.y);
gtk_notebook_paint (widget, cr);
- cairo_restore (cr);
-
if (priv->show_tabs)
{
GtkNotebookPage *page;
gtk_widget_get_allocation (widget, &allocation);
- x = allocation.x + border_width;
- y = allocation.y + border_width;
+ x = border_width;
+ y = border_width;
width = allocation.width - border_width * 2;
height = allocation.height - border_width * 2;
GtkNotebookPrivate *priv;
GtkWidget *widget;
GtkStyleContext *context;
+ GtkAllocation allocation;
if (!NOTEBOOK_IS_TAB_LABEL_PARENT (notebook, page) ||
!gtk_widget_get_mapped (page->tab_label) ||
widget = GTK_WIDGET (notebook);
priv = notebook->priv;
+ gtk_widget_get_allocation (gtk_widget_get_parent (page->tab_label), &allocation);
context = gtk_widget_get_style_context (widget);
gtk_style_context_save_to_node (context, page->cssnode);
gtk_render_background (context, cr,
- page->allocation.x,
- page->allocation.y,
+ page->allocation.x - allocation.x,
+ page->allocation.y - allocation.y,
page->allocation.width,
page->allocation.height);
gtk_render_frame (context, cr,
- page->allocation.x,
- page->allocation.y,
+ page->allocation.x - allocation.x,
+ page->allocation.y - allocation.y,
page->allocation.width,
page->allocation.height);
if (gtk_widget_has_visible_focus (widget) &&
priv->cur_page == page)
{
- GtkAllocation allocation;
+ GtkAllocation label_allocation;
- gtk_widget_get_allocation (page->tab_label, &allocation);
+ gtk_widget_get_allocation (page->tab_label, &label_allocation);
gtk_render_focus (context, cr,
- allocation.x,
- allocation.y,
- allocation.width,
- allocation.height);
+ label_allocation.x - allocation.x,
+ label_allocation.y - allocation.y,
+ label_allocation.width,
+ label_allocation.height);
}
gtk_style_context_restore (context);
GtkNotebookPrivate *priv = notebook->priv;
GtkStyleContext *context;
GtkWidget *widget;
+ GtkAllocation allocation;
GdkRectangle arrow_rect;
gint scroll_arrow_hlength;
gint scroll_arrow_vlength;
context = gtk_widget_get_style_context (widget);
gtk_notebook_get_arrow_rect (notebook, &arrow_rect, nbarrow);
+ gtk_widget_get_allocation (widget, &allocation);
+ arrow_rect.x -= allocation.x;
+ arrow_rect.y -= allocation.y;
gtk_widget_style_get (widget,
"scroll-arrow-hlength", &scroll_arrow_hlength,